package com.example.novelstory.controller.jqx;

//import com.example.demo.entity.Message;
//import com.example.demo.service.jzx.MessageServiceImpl;
import com.example.novelstory.entity.Message;
import com.example.novelstory.service.jzx.MessageServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@CrossOrigin
@Api(tags = "评论测试总接口")
public class MessageController {
    @Resource
    MessageServiceImpl messageServer;
//    全查
//    接口名称，类型
    @PostMapping(value = "/findAll")
    @ApiOperation(value = "测试全查接口")
    public List<Message> testFindAll(){
//        List<Message> findAll = novelServer.findAll();
        return messageServer.findAll();

    }
//       增加
    @PostMapping(value = "/addMessage")
    @ApiOperation("添加评论接口")
    public boolean addMessage(Message message) {
//        List<Message> addMessage = messageServer.addMessage(content, create_time, uid, status, up, pid, mid, type);
        return messageServer.addMessage(message);
    }
//       删除
    @PostMapping(value = "/deleteMessage")
    @ApiOperation("删除评论接口")
    public boolean deleteMessage(int id){
//        List<Message> deleteMessage = messageServer.deleteMessage(id);
        return messageServer.deleteMessage(id);
    }
}